package com.springcloud.sc.ucpv5.client.commondata.data;

import com.springcloud.sc.ucpv5.client.commondata.datachange.DataExChange;
import com.google.protobuf.Message;
import lombok.Data;

/**
 * Generated from IDL struct "Node".
 *
 * @author JacORB IDL compiler V 2.3-beta-2, 14-Oct-2006
 * @version generated at 2014-10-29 11:48:54
 */
@Data
public final class Node extends DataExChange {
    public Node() {
    }

    public String NodeNumber = "";
    public String ParentNumber = "";
    public String NodeName = "";
    public int NodeType;
    public String NodeIP = "";
    public int Point_x;
    public int Point_y;
    public String Background = "";
    public String Background1 = "";
    public int Local_Point_x;
    public int Local_Point_y;
    public int IS_VIRTURL;
    public String Physics_NodeNumber = "";
    public String longitude = "";
    public String latitude = "";
    public String zoom = "";

    public Node(String NodeNumber, String ParentNumber, String NodeName, int NodeType, String NodeIP, int Point_x,
                int Point_y, String Background, String Background1, int Local_Point_x, int Local_Point_y, int IS_VIRTURL,
                String Physics_NodeNumber, String longitude, String latitude, String zoom) {
	this.NodeNumber = NodeNumber;
	this.ParentNumber = ParentNumber;
	this.NodeName = NodeName;
	this.NodeType = NodeType;
	this.NodeIP = NodeIP;
	this.Point_x = Point_x;
	this.Point_y = Point_y;
	this.Background = Background;
	this.Background1 = Background1;
	this.Local_Point_x = Local_Point_x;
	this.Local_Point_y = Local_Point_y;
	this.IS_VIRTURL = IS_VIRTURL;
	this.Physics_NodeNumber = Physics_NodeNumber;
	this.longitude = longitude;
	this.latitude = latitude;
	this.zoom = zoom;
    }
    

    public Message dataChangeCommonToProBufData() {
	try {
	    com.proto.uuos_sdk_pb.Node.Builder builder_dst = com.proto.uuos_sdk_pb.Node.newBuilder();
	    builder_dst.setNodeNumber(NodeNumber);
	    builder_dst.setParentNumber(ParentNumber);
	    builder_dst.setNodeName(NodeName);
	    builder_dst.setNodeType(NodeType);
	    builder_dst.setNodeIP(NodeIP);
	    builder_dst.setPointX(Point_x);
	    builder_dst.setPointY(Point_y);
	    builder_dst.setBackground(Background);
	    builder_dst.setBackground1(Background1);
	    builder_dst.setLocalPointX(Local_Point_x);
	    builder_dst.setLocalPointY(Local_Point_y);
	    builder_dst.setISVIRTURL(IS_VIRTURL);
	    builder_dst.setPhysicsNodeNumber(Physics_NodeNumber);
	    builder_dst.setLongitude(longitude);
	    builder_dst.setLatitude(latitude);
	    builder_dst.setZoom(zoom);

	    Message pbMessage = builder_dst.build();
	    return pbMessage;
	} catch (Exception e) {

	}

	return null;
    }

    /**
     * 从probuf对象获取当前对象
     * 
     * @param builder_src
     * @return
     */
    public void dataChangeProBufDataToCommon(Message builder_src) {
	try {
	    com.proto.uuos_sdk_pb.Node userInfo = (com.proto.uuos_sdk_pb.Node) builder_src;
	    
	    NodeNumber=userInfo.getNodeNumber();
	    ParentNumber=userInfo.getParentNumber();
	    NodeName=userInfo.getNodeName();
	    NodeType=userInfo.getNodeType();
	    NodeIP=userInfo.getNodeIP();
	    Point_x=userInfo.getPointX();
	    Point_y=userInfo.getPointY();
	    Background=userInfo.getBackground();
	    Background1=userInfo.getBackground1();
	    Local_Point_x=userInfo.getLocalPointX();
	    Local_Point_y=userInfo.getLocalPointY();
	    IS_VIRTURL=userInfo.getISVIRTURL();
	    Physics_NodeNumber=userInfo.getPhysicsNodeNumber();
	    longitude=userInfo.getLongitude();
	    latitude=userInfo.getLatitude();
	    zoom=userInfo.getZoom();
	} catch (Exception e) {
	    e.printStackTrace();
	}
    }
}
